package {{ package }};
import {{ entity_package }};
import {{ mapper_package }};
import {{ service_package }};
import com.github.pagehelper.PageInfo;
import java.util.List;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @detail {{ class_name }}实现类
 * @author {{ createName }}
 * @date  {{ date }}
 **/
@SuppressWarnings("ALL")
@Service("{{ small_class_name }}Service")
public class {{ class_name }}ServiceImpl implements {{ class_name }}Service {
    @Autowired
    {{ class_name }}Mapper {{ small_class_name }}Mapper;

    public PageInfo<{{ class_name }}> getAll{{ class_name }}ByPage({{ class_name }} {{ small_class_name }}, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum
                , pageSize);
        List<{{ class_name }}> list = {{ small_class_name }}Mapper.getAll{{ class_name }}({{ small_class_name }});
        PageInfo<{{ class_name }}> p = new PageInfo<{{ class_name }}>(list);
        return p;
    }

    public List<{{ class_name }}> getAll{{ class_name }}({{ class_name }} {{ small_class_name }}){
        return {{ small_class_name }}Mapper.getAll{{ class_name }}({{ small_class_name }});
    }


    public List<{{ class_name }}> get{{ class_name }}ByParams({{ class_name }} {{ small_class_name }}) {
        return {{ small_class_name }}Mapper.get{{ class_name }}ByParams({{ small_class_name }});
    }

    public int save{{ class_name }}({{ class_name }} {{ small_class_name }}){
        return {{ small_class_name }}Mapper.save{{ class_name }}({{ small_class_name }});
    }

    public int delete{{ class_name }}({{ class_name }} {{ small_class_name }}){
        return {{ small_class_name }}Mapper.delete{{ class_name }}({{ small_class_name }});
    }

    public int update{{ class_name }}({{ class_name }} {{ small_class_name }}){
        return {{ small_class_name }}Mapper.update{{ class_name }}({{ small_class_name }});
    }

}
